Picture brightness adjusted motion detection

ABSTRACT

An apparatus includes an input circuit configured to receive a sequence of pictures and a processing circuit. The processing circuit may be configured to (i) determine respective picture brightness values for each of a reference picture and a target picture selected from the sequence of pictures, (ii) remap image data of at least one of the reference picture and the target picture based upon the respective picture brightness values, and (iii) perform motion detection between the reference picture and the target picture utilizing the remapped image data.

FIELD OF THE INVENTION

The present invention relates to video signal processing generally and,more particularly, to a picture brightness adjusted motion detection.

BACKGROUND OF THE INVENTION

Conventional motion detection can lead to a false positive (i.e., motiondetected where there is none) related to picture brightness changes fromframe to frame. False positives can occur (i) when there is an abruptchange in lighting, (ii) when an analog or a digital gain is changed onthe sensor, and/or (iii) when a digital gain is changed after data hasbeen read from the sensor.

It would be desirable to implement a picture brightness adjusted motiondetection.

SUMMARY OF THE INVENTION

The present invention concerns an apparatus including an input circuitconfigured to receive a sequence of pictures and a processing circuit.The processing circuit may be configured to (i) determine respectivepicture brightness values for each of a reference picture and a targetpicture selected from the sequence of pictures, (ii) remap image data ofat least one of the reference picture and the target picture based uponthe respective picture brightness values, and (iii) perform motiondetection between the reference picture and the target picture utilizingthe remapped image data.

The objects, features and advantages of the present invention includeproviding picture brightness adjusted motion detection that may (i)measure picture brightness of a frame prior to motion detection, (ii)remap picture data by scaling the picture data, (iii) remap picture databy applying an offset value, (iv) remap picture data by utilizing alookup table, and/or (v) be implemented in one or more integratedcircuits.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other objects, features and advantages of the presentinvention will be apparent from the following detailed description andthe appended claims and drawings in which:

FIG. 1 is a diagram illustrating a video processing system in accordancewith an example embodiment of the invention;

FIG. 2 is a diagram illustrating a picture brightness adjusted motiondetection apparatus in accordance with an example embodiment of theinvention;

FIG. 3 is a diagram illustrating remapping techniques in accordance withexample embodiments of the invention;

FIG. 4 is a flow diagram illustrating an example of determining valuesof entries in a lookup table in accordance with an example embodiment ofthe invention;

FIG. 5 is a flow diagram illustrating another example of determiningvalues of entries in a lookup table in accordance with an exampleembodiment of the invention;

FIG. 6 is a flow diagram illustrating still another example ofdetermining values of entries in a lookup table in accordance with anexample embodiment of the invention;

FIG. 7 is a flow diagram illustrating a picture brightness adjustedmotion detection process in accordance with an example embodiment of theinvention; and

FIG. 8 is a flow diagram illustrating a picture brightness adjustedmotion detection process in accordance with another example embodimentof the invention.

DETAILED DESCRIPTION OF EMBODIMENTS

Referring to FIG. 1, a block diagram of a camera system 100 is shownillustrating an example implementation of a camera/recorder system (orapparatus). In some embodiments, the camera system 100 may be a digitalvideo camera, a digital still camera, or a hybrid digital video/stillcamera. In various embodiments, the electronics of the camera system 100may be implemented as one or more integrated circuits. For example, anapplication specific integrated circuit (ASIC) or a system-on-a-chip(SOC) may be used to implement a processing portion of the camera system100.

In various embodiments, the camera system 100 may comprise a camera chip(or circuit) 102, a lens assembly 104, an image sensor 106, an audiocodec 108, dynamic random access memory (DRAM) 110, non-volatile memory(e.g., NAND flash memory, etc.) 112, one or more serial interfaces 114,an interface 116 for connecting to or acting as a universal serial bus(e.g., USB) host, an interface for connecting to a removable media 118(e.g., SD—secure digital media, SDXC—secure digital extended capacitymedia, etc.), a wireless interface 120 for communicating with a portableuser device, a microphone 122 for recording audio, and a speaker 124 forplaying audio. In some embodiments, the lens assembly 104 and the imagesensor 106 may be part of a separate camera connected to the processingportion of the system 100 (e.g., via a video cable, a high definitionmedia interface (e.g., HDMI) cable, a USE cable, an ethernet cable, orwireless link).

In various embodiments, the circuit 102 may comprise a number of modules(or circuits) including, but not limited to, a pulse width modulation(e.g., PWM) module, a real time clock and watchdog timer (RTC/WDT), adirect memory access (DMA) engine, a high-definition multimediainterface (e.g., HDMI), an LCD/TV/Parallel interface, a general purposeinput/output interface (e.g., GPIO) and analog-to-digital converter(e.g., ADC) module, an infrared (IR) remote interface, a secure digitalinput output interface (e.g., SDIO) module, a secure digital (e.g., SD)card interface, an audio I²S interface, an image sensor input interface,and a synchronous data communications interface (e.g., IDC SPI/SSI). Thecircuit 102 may also include an embedded processor (e.g., ARM, etc.), animage digital signal processor (DSP), and a video and/or audio DSP. Inembodiments incorporating the lens assembly 104 and image sensor 106 inthe system 100, the circuit 102 may be configured (e.g., programmed) tocontrol the lens assembly 104 and receive image data from the sensor106. The wireless interface 120 may include support for wirelesscommunication by one or more wireless protocols such as Bluetooth®,ZigBee®, and/or one or more Institute of Electrical and ElectronicsEngineering (IEEE) protocol standards (e.g., IEEE 802.11, IEEE 802.15,IEEE 802.15.1, IEEE 802.15.2, IEEE 802.15.3, IEEE 802.15.4, IEEE802.15.5, IEEE 802.20, etc). The circuit 102 may also includecommunication support using one or more universal serial bus (USE)protocols (e.g., 1.0, 2.0, 3.0, etc.). The circuit 102 may also beconfigured to be powered via the USB connection. However, othercommunication and/or power interfaces may be implemented accordingly tomeet the design criteria of a particular implementation.

In various embodiments, programming code (e.g., executable instructionsfor controlling various processors of the circuit 102) implementingpicture brightness adjusted motion detection in accordance with anembodiment of the invention may be stored in one or more of the memories110 and 112. When executed by the circuit 102, the programming codegenerally enables the circuit 102 to capture a sequence of pictures fromthe sensor 106, determine respective picture brightness values for apair of pictures (e.g., a reference picture and a target picture)selected from the sequence of pictures, remap image data of either thereference picture or the target picture, and perform a motion detectionoperation between the reference and the target pictures using theremapped picture data. In various embodiments, the circuit 102 mayselect the particular picture whose image data is remapped based on aconfiguration setting, a user input (e.g., a mode control), and/or apredetermined criterion.

Referring to FIG. 2, a diagram is shown illustrating a picturebrightness adjusted motion detection apparatus in accordance with anexample embodiment of the invention. In various embodiments, a picturebrightness adjusted motion detection apparatus 200 may comprise a block(or circuit) 202, a block (or circuit) 204, a block (or circuit) 206,and a block (or circuit) 208. The block 202 may be configured to receiveand store a number or sequence of pictures or frames (e.g., F1, . . . ,Fn). The block 204 may be configured to determine picture brightnessvalues for a reference picture (e.g., REF) and a target picture (e.g.,TRGT) selected from the pictures stored in the block 202. In variousembodiments, the block 204 may determine the picture brightness valuesbased on actual measurements, gain information (e.g., analog, digital,or both analog and digital gains associated with each picture), or anycombination thereof.

The block 206 may be configured to remap image data of either thereference picture or the target picture based on the picture brightnessvalues generated in the block 204. The block 206 operating inconjunction with the block 208 generally implements a picture brightnessmotion detection adjustment technique in accordance with an embodimentof the invention. In some embodiments, the block 206 determines which ofthe reference and target pictures gets remapped based upon which pictureis darker than the other. In some embodiments, the block 206 determineswhich of the reference and target pictures gets remapped based upon amode input (e.g., MODE). In some embodiments, the block 206 may beconfigured to remap the selected image data using a determinedmultiplier factor. In some embodiments, the block 206 may be configuredto remap the selected image data using determined values in a lookuptable (e.g., LUT 210). In some embodiments, the LUT 210 is implementedseparately from the block 206. In some embodiments, the LUT 210 may beimplemented as part of the block 206.

In various embodiments, the block 208 may be configured to performmotion detection between two images received from the block 206, whereone image has remapped image data and the other image has the originalimage data retrieved from the block 202. In some embodiments, the block208 may be configured to receive only the remapped image data of theadjusted picture from the block 206 and retrieve the original image dataof the unadjusted picture from the block 202. In one example, the block202 may be implemented as part of an input circuit configured to receivea sequence of pictures and the blocks 204-208 may be implemented by aprocessing circuit configured to manipulate image data using techniquesin accordance with the present invention. In some embodiments, the block202 may comprise or be associated with one or more storage media (e.g.,dynamic random access memory (DRAM), static random access memory (SRAM),Flash memory, etc.) configured to store the sequence of pictures. Insome embodiments, the sequence of pictures may be stored in an externalmemory device, and the reference and target pictures brought into afaster internal memory associated with (tightly coupled to) a processor(e.g., DSP, MPU, CPU, etc.) configured to motion compensate the picturesin accordance with an embodiment of the invention.

In various embodiments, picture brightness is used to remap eitherreference picture data or target picture data prior to motion detection.The motion detection may be performed, but is not limited to, usingconventional motion detection techniques. In various embodiments, thepicture (or frame) brightness may be determined based on one or more of(i) a known analog gain used on the sensor 106, (ii) a known digitalgain used on the sensor 106 or applied after the sensor 106, and (iii)an actual measured picture brightness. In one example, picturebrightness may be measured by averaging pixel values received from thesensor 106.

Various techniques may be implemented to remap the image data of eitherthe reference picture or the target picture. In some embodiments,remapping comprises multiplying the image data of the selected pictureusing an appropriate multiplication factor or multiplier. For example,in an embodiment where the target picture is to be remapped, if thereference picture is determined to be 10% brighter than the targetpicture, the image data of the target picture may be multiplied by afactor of 1.1. In various embodiments, samples (image data) may beremapped using values in a lookup table. In some embodiments, samplesmay be remapped using a one-dimensional (1D) lookup table. Embodimentsimplementing a 1D lookup table may be used for:

-   -   1. sum-of-absolute-difference (SAD) on luminance (luma) samples        (e.g., using a luma→luma lookup); and    -   2. SAD on red, green, and blue (RGB) samples (e.g., using R→R,        B→B and G→G lookup).        Remapping the samples using the 1D lookup table may provide        better performance than multiplying the samples by a multiplier        when the samples on which the SAD is being performed are not        linearly related to the picture brightness (e.g., when the        samples have been gamma corrected).

In some embodiments, a multi-dimensional (nD) lookup table may be used.The multi-dimensional lookup table may be implemented as many-to-1 ormany-to-many. Embodiments implementing the multi-dimensional lookup mayinclude, but are not limited to:

-   -   1. RGB→RGB lookup, SAD on RGB (many-to-many);    -   2. YUV→YUV lookup, SAD on YUV (many-to-many); and    -   3. YUV→Y lookup, SAD on Y (luma) only (many-to-1).        Embodiments implementing the multi-dimensional lookup may        perform better than embodiments implementing the 1D lookup when        the samples on which the SAD is being performed have undergone a        mixture of channels (e.g., color correction).

Various embodiments (or modes) may be implemented with respect to whichpicture (or frame) is remapped. In a first embodiment (or mode), thereference frame is always remapped. In a second embodiment (or mode),the target frame is always remapped. In a third embodiment (or mode), anadaptive technique may be implemented where the remapped image isselected based upon some criterion (e.g., the darker frame is remapped,etc.). Embodiments implementing the adaptive technique may providebetter results when some samples in the brighter frame are at saturation(e.g., equal to a maximum possible value) and cannot be reliablyremapped. For example, in a system where the sample values can rangefrom 0 to 255, beyond a certain brightness level all brightness levelswill be represented as sample value of 255. If a sample in the brighterframe has a value of 255, the underlying amount of light that the pixelrepresents could be arbitrarily high. If the frame brightness should bereduced by 10%, there is no way to know how much the remapped valueshould be lower than 255 or if the remapped value should be lower than255 at all. In embodiments where multiple modes are available, a signal(e.g., MODE) may be implemented to allow selection of a particular modeto be applied.

Referring to FIG. 3, a diagram is shown illustrating exampleimplementations of remapping apparatus in accordance with embodiments ofthe invention. In various embodiments, a brightness change factor may bedetermined, for example, based on gain information and/or average pixelvalues of the reference and target pictures. In some embodiments, amultiplier circuit may be used to remap image data. A multiplier factorcan, for example, be computed based upon the brightness change factorbetween two pictures. In some embodiments, a lookup table may begenerated to remap image data.

In one example, an apparatus (or system or camera) 220 may implement apicture brightness adjusted motion detection process in accordance withan embodiment of the invention. In various embodiments, the apparatus220 may comprise a block (or circuit) 222, a block (or circuit) 224, ablock (or circuit) 226, and a block (or circuit) 228. The block 222 mayimplement a brightness change factor calculation module. The block 224may implement a multiplier. The block 226 may implement a lookup tableentry calculation module. The block 228 may implement a lookup table.The lookup table 228 may be used as the LUT 210 in FIG. 2.

The block 222 may receive an average pixel value for the referencepicture, an average pixel value for the target picture, and gaininformation (e.g., GAIN INFO) for both the reference and the targetpictures. The gain information may include analog and/or digital gainvalues associated with each the reference picture and the targetpicture. The block 222 is configured to generate a brightness changefactor based on one or more of the gain information for the referencepicture, the gain information for the target picture, the average pixelvalue for the reference picture, and/or the average pixel value for thetarget picture. The block 224 may be configured to generate remappedimage data for the selected picture by multiplying the original imagedata of the selected picture by the brightness change factor. The block226 may be configured to calculate entry values for the block 228 basedin part upon the brightness change factor. The block 228 may beconfigured to generate remapped image data for the selected picture inresponse to the original image data of the selected picture.

In one example, the reference picture may use a first gain (e.g., G1 dB)and the target picture may use a second gain (e.g., G2 dB). The firstand second gains may be digital, analog, or a combination of digital andanalog. If the only difference in brightness is due to a difference inthe gains (e.g., G1 does not equal G2), the difference in brightnessbetween the reference and the target pictures may be expressed in termsof the respective gains (e.g., the target picture is 10^(((G2−G1)/20))times brighter than the reference picture). For example, if thereference picture uses a gain of 10 dB and the target picture uses again of 11 dB, the target picture is about 1.122 times brighter than thereference picture.

In a second example, if the average pixel value of the target picture is5% higher than the average pixel value of the reference picture, thetarget picture may be said to be 1.05 times brighter than the referencepicture. The average pixel value is typically measured after an analoggain is applied and before a digital gain is applied. When the averagepixel value is measured after application of the analog gain and beforeapplication of the digital gain, if average pixel values and gains areused to determine brightness values, then only the digital gaindifferences need be taken into consideration because any analog gaindifferences are already accounted for by the averaging of the pixelvalue measurements.

In a third example, if (i) the average pixel value of the target pictureis 5% higher than the average pixel value of the reference picture, (ii)the reference picture uses a digital gain of 10 dB, and (iii) the targetpicture uses a digital gain of 11 dB, the target picture would bedetermined to be about 1.178 (e.g., 1.122×1.05 equals approximately1.178) times brighter than the reference picture.

When the picture brightness differences are compensated for by remappingimage data of the reference picture by using a multiplier, then inexamples 1, 2, and 3 above the samples in the target picture would bemultiplied by 1.122, 1.05, and 1.178, respectively. If the modificationof the reference picture is done after gamma (tone) correction and donewith a one dimensional lookup table (e.g., the lookup table 244implemented as a 1D LUT), the lookup table 244 may be programmed (e.g.,the values of the lookup table entries may be determined) based upon thefactor calculated in the block 222 as described below in connection withthe examples illustrated in FIGS. 4-6.

Referring to FIG. 4, a flow diagram is shown illustrating a process 230for determining values of entries in a lookup table in accordance withan example embodiment of the invention. The process (or method) isillustrated for a table with 64 entries (e.g., indices 0-63) and samplevalues [0,255]. The value of an entry K, where K is in [0,63], may bedetermined as follows. In a step (or state) 232, for a pixel with K/64of the maximum value after gamma correction, the process 230 calculatesa value A as the pixel value before gamma correction (e.g., by invertingthe gamma curve). In a step (or state) 234, the process 230 calculates avalue B equal to the value A multiplied by the brightness change factor(e.g., by 1.122, 1.05, and 1.178, respectively, in examples 1, 2, and 3above). In a step (or state) 236, the process 230 calculates a value Cequal to the value B clamped to the maximum brightness value. In a step(or state) 238, the process 230 calculates a value D by applying thegamma curve to the value C. In a step (or state) 240, the process 230sets the entry K to the value D.

In the above example, the number of table entries (64) is fewer than thenumber of sample values (256), so when the lookup table is usedinterpolation is needed. For example, an input sample with a value of 16would use the entry at index 4, but an input sample with a value of 17would use three-fourths times the entry at index 4 plus one-fourth timesthe entry at index 5. In another embodiment, a table with 256 entriesmay be used to avoid interpolation.

Referring to FIG. 5, a flow diagram is shown illustrating a process 250for determining values of entries in a lookup table in accordance withan example embodiment of the invention. When the modification(remapping) of the image data of the reference picture is done (i) onRGB samples after color correction and gamma (tone) correction and (ii)with a 3D→3D lookup table, the lookup table may be programmed, in oneexample, using the process 250. In a step (or state) 252, the process250 begins determining values for each entry in the lookup table. In astep 254, the process 250 determines the corresponding input RGB values,R1, G1, B1 for a current entry. In a step (or state) 256, the process250 determines values R2, G2, B2 corresponding to (R1, G1, B1) beforecolor and gamma correction (e.g., by applying inverse color correctionand gamma correction). In a step (or state) 258, the process 250computes values R3, G3, B3 as each of the values R2, G2, B2 multipliedby the brightness change factor (e.g., by multiplying values R3, G3, B3by 1.122, 1.05, and 1.178, respectively, from examples 1, 2, and 3above). In a step (or state) 260, the process 250 computes values R4,G4, B4 as each of the values R3, G3, B3 clamped to the maximum samplevalue. In a step (or state) 262, the process 250 computes values R5, G5,B5 as the values R4, G4, B4 after color correction and gamma correction(e.g., by applying color correction and gamma correction to the valuesR4, G4, B4). In a step (or state) 264, the process 250 stores the valuesR5, G5, B5 in the current lookup table entry. In the step 266, theprocess 250 moves to the step 254 to determine the next lookup tableentry. The process 250 continues until all the entries of the entirelookup table have been determined.

Referring to FIG. 6, a flow diagram is shown illustrating a process 270for determining the values of entries in a lookup table in accordancewith another example embodiment of the invention. If the modification(remapping) of the reference picture is done on YUV samples after colorcorrection and gamma (tone) correction applying an RGB→YUV matrix, andif the modification is done with a 3D→3D (YUV→YUV) lookup table, thelookup table may be programmed, for example, using the process 270.

In a step (or state) 272, the process 270 may determine values for eachentry in the table. In a step 274, the process 270 may determine thecorresponding input YUV values, Y1, U1, V1 for a current lookup tableentry. In a step (or state) 276, the process 270 calculates the RGBvalues R1, G1, B1 for the YUV values Y1, U1, V1 (e.g., by inverting theRGB→YUV matrix). In a step (or state 278, the process 270 determinesvalues R2, G2, B2 corresponding to (R1, G1, B1) before color and gammacorrection (e.g., by applying inverse color correction and gammacorrection). In a step (or state) 280, the process 270 calculates thevalues R3, G3, B3 as each of the values R2, G2, B2 multiplied by thebrightness change factor (e.g., by multiplying the values R2, G2, B2 by1.122, 1.05, and 1.178, respectively, in examples 1, 2, and 3 above). Ina step (or state) 282, the process 270 calculates the values R4, G4, B4as each of the values R3, G3, B3 clamped to the maximum sample value. Ina step (or state) 284, the process 270 calculates the values R5, G5, B5as the values R4, G4, B4 after color correction and gamma correction(e.g., by applying color correction and gamma correction to the valuesR4, G4, B4). In a step 286, the process 270 calculates the values Y2,U2, V2 as the YUV values for RE, G5, B5 (e.g., by applying the RGB→YUVmatrix). In a step or (state) 288, the process 270 stores the values Y2,U2, V2 as the lookup table entry. In a step (or state) 290, the process270 moves to the step 274 to determine the next lookup table entry. Theprocess 270 continues until all the entries of the entire lookup tablehave been determined.

If the modification (remapping) of the reference picture is done on YUVsamples after color correction and gamma (tone) correction applying anRGB→YUV matrix, and if the modification is done with a 3D→1D (YUV→Y)lookup table, the lookup table may be programmed, for example, similarlyto the description above, but only Y2, and not U2 and V2, may becomputed.

Remapping the reference picture using RGB→RGB, YUV→YUV or YUV→Y lookuptables utilizes a lookup in a 3D table. In one implementation, the 3Dtable may cover all possible values of the input. Such an implementationcould be quite costly. For example, if each input can have 256 values(0-255), then the 3D table would need 256³=16,777,216 entries. A morepractical implementation may use a smaller table (e.g., 16×16×16 or32×32×32) and interpolation of the table (for remapping the selectedpicture). The interpolation of the table may be achieved usingconventional techniques such as those disclosed in U.S. Pat. No.4,275,413.

Referring to FIG. 7, a flow diagram is shown illustrating a picturebrightness adjusted motion detection method 300 in accordance with anexample embodiment of the present invention. The method (or process) 300may be performed by the circuit 102. The method 300 generally comprisesa step (or state) 302, a step (or state) 304, a step (or state) 306, astep (or state) 308, and a step (or state) 310. The steps 302-310 may beimplemented in an apparatus (or circuit or device) using hardware,software, firmware, or any combination thereof.

In the step 302, the circuit 102 may receive raw sensor data (e.g., fromthe sensor 106 via the sensor input block). Optional image processingsteps (e.g., black level correction, gain (e.g. digital) adjustment,demosaicing, color correction matrix, gamma correction, color spaceconversion, etc.) may be performed, for example, using the digitalsignal processing (DSP) blocks of the circuit 102. In the step 304, thecircuit 102 may determine picture brightness for each of the referenceand the target frames (e.g., REF and TRGT, respectively). In someembodiments, the picture brightness of each frame is determined byactual measurement (e.g., averaging pixel values, etc.). In someembodiments, the picture brightness is determined based on a gain(digital and/or analog) applied to the picture. In still otherembodiments, the particular method used to determined picture brightnessis configurable. In the step 306, the circuit 102 may select which frameto remap based upon a configuration or mode selection. In variousembodiments, the reference frame is remapped when a first mode (e.g.,MODE 1) is selected, and the target frame is remapped when a second mode(e.g., MODE 2) is selected. In some embodiments, a third mode (e.g.,MODE 3) is implemented allowing adaptive selection of which frame isremapped). In some embodiments, only the third mode is implemented. Forexample, the circuit 102 adaptively selects which frame to remap basedupon determined respective picture brightness values of the referenceand target frames (e.g., the darker frame is selected for remapping,etc.). In the step 308, the circuit 102 remaps the data of the selectedframe using a predetermined technique (e.g., using a multiplier value, a1D lookup, a multi-dimensional lookup, etc.). In some embodiments, theparticular remapping technique used is configurable. In the step 310,the circuit 102 performs motion detection utilizing the remapped picturedata. The motion detection may be performed according to, but notlimited to, conventional techniques.

Referring to FIG. 8, a flow diagram is shown illustrating a picturebrightness adjusted motion detection method 400 in accordance with anexample embodiment of the present invention. The method (or process) 400may be performed by the circuit 102. The method 400 generally comprisesa step (or state) 402, a step (or state) 404, a step (or state) 406, astep (or state) 408, a step (or state) 410, and a step (or state) 412.The steps 402-412 may be implemented in an apparatus (or circuit ordevice) using hardware, software, firmware, or any combination thereof.

In the step 402, the circuit 102 may determine picture brightness foreach of the reference and the target frames (e.g., REF and TRGT,respectively). In some embodiments, the picture brightness of each frameis determined by actual measurement. In some embodiments, the picturebrightness is determined based on a gain (digital and/or analog) appliedto the picture. In still other embodiments, the particular method usedto determined picture brightness is configurable. In the step 404, thecircuit 102 may select the darker frame to be remapped. When thereference frame is darker than the target frame, the process 400 movesto the step 406. When the reference frame is brighter than the targetframe, the process 400 moves to the step 408. In the step 406, thecircuit 102 remaps the image data of the reference frame. In the step408, the circuit 102 remaps the image data of the target frame. Thecircuit 102 remaps the data of the selected frame using a predeterminedtechnique (e.g., using a multiplier, a 1D lookup, or a multi-dimensionallookup). In some embodiments, the particular remapping technique used isconfigurable.

When the image data of the reference frame has been remapped in the step406, the process 400 moves to the step 410. When the image data of thetarget frame has been remapped in the step 408, the process 400 moves tothe step 412. In the step 410, the circuit 102 performs motion detectionutilizing the remapped image data of the reference frame and theoriginal data of the target frame. In the step 412, the circuit 102performs motion detection utilizing the remapped image data of thetarget frame and the original data of the reference frame.

The functions and structures illustrated in the diagrams of FIGS. 1-8may be designed, modeled and/or simulated using one or more of aconventional general purpose processor, digital computer,microprocessor, microcontroller and/or similar computational machines,programmed according to the teachings of the present specification, aswill be apparent to those skilled in the relevant art(s). Appropriatesoftware, firmware, coding, routines, instructions, opcodes, microcode,and/or program modules may readily be prepared by skilled programmersbased on the teachings of the present disclosure, as will also beapparent to those skilled in the relevant art(s). The software isgenerally embodied in a medium or several media, for example anon-transitory storage media, and may be executed by one or more of theprocessors. As used herein, the term “simultaneously” is meant todescribe events that share some common time period but the term is notmeant to be limited to events that begin at the same point in time, endat the same point in time, or have the same duration.

While the invention has been particularly shown and described withreference to the preferred embodiments thereof, it will be understood bythose skilled in the art that various changes in form and details may bemade without departing from the scope of the invention.

The invention claimed is:
 1. An apparatus comprising: an input circuitconfigured to receive a sequence of pictures; and a processing circuitconfigured to (i) determine a first picture brightness valuerepresenting an overall brightness of a reference picture selected fromsaid sequence of pictures and a second picture brightness valuerepresenting an overall brightness of a target picture selected fromsaid sequence of pictures, (ii) select at least one of said referencepicture or said target picture to be remapped, where said selection ismade based upon the first and the second picture brightness values,(iii) generate a brightness change factor based on one or more of gaininformation for said reference picture, gain information for said targetpicture, an average pixel value for said reference picture, and anaverage pixel value for said target picture, (iv) remap image data ofthe selected picture by calculating new pixel values using originalpixel values of the selected picture and said brightness change factor,and (v) perform motion detection between said reference picture and saidtarget picture utilizing the remapped image data of the at least one ofsaid reference picture and said target picture and original image dataof the picture that was not remapped.
 2. The apparatus according toclaim 1, wherein said processing circuit is configured to determine therespective picture brightness values using one or both of (i) actualmeasurements of picture brightness of said reference picture and saidtarget picture and (ii) respective gain or gains applied to each of saidreference picture and said target picture.
 3. The apparatus according toclaim 1, wherein in said processing circuit is configured to remap saidimage data based on at least one of (i) an average pixel value of eachof said reference picture and said target picture, (ii) digital gainsapplied to each of said reference picture and said target picture, and(iii) analog gains applied to each of said reference picture and saidtarget picture.
 4. The apparatus according to claim 1, wherein saidprocessing circuit remaps said image data of whichever picture is darkerthan the other.
 5. The apparatus according to claim 1, wherein saidprocessing circuit is further configured to calculate said new pixelvalues by: determining a multiplier value based on one or more of (i) anactual measured picture brightness of each of said reference picture andsaid target picture, (ii) an average pixel value of each of saidreference picture and said target picture, (iii) digital gains appliedto each of said reference picture and said target picture, and (iv)analog gains applied to each of said reference picture and said targetpicture; and multiplying the original pixel values of the at least oneof said reference picture or said target picture by said multipliervalue.
 6. The apparatus according to claim 1, wherein: said processingcircuit is further configured to remap said image data by using each ofsaid original pixel values as an index into at least one of aone-dimensional lookup table and a multi-dimensional lookup table; andentries in said lookup tables are calculated based on said brightnesschange factor.
 7. The apparatus according to claim 1, wherein saidprocessing circuit is further configured to perform at least one ofgamma correction and color correction on said image data prior toremapping.
 8. An apparatus comprising: an input circuit configured toreceive a sequence of pictures; and a processing circuit configured to(i) determine respective picture brightness values for a referencepicture and a target picture selected from said sequence of pictures,(ii) remap image data of at least one of said reference picture and saidtarget picture based upon the respective picture brightness values, and(iii) perform motion detection between said reference picture and saidtarget picture utilizing the remapped image data, wherein saidprocessing circuit is further configured to remap said reference picturein a first mode, said target picture in a second mode, and selectivelychoose remapping said reference picture or remapping said target picturein a third mode.
 9. The apparatus according to claim 8, wherein in saidthird mode said processing circuit is configured to remap said imagedata based on actual measured picture brightness.
 10. The apparatusaccording to claim 1, further comprising a storage medium storing saidsequence of pictures.
 11. The apparatus according to claim 1, whereinsaid apparatus is fabricated on one or more integrated circuits.
 12. Amethod of performing motion detection comprising: receiving a sequenceof pictures; determining a first picture brightness value representingan overall brightness of a reference picture selected from said sequenceof pictures and a second picture brightness value representing anoverall brightness of a target picture selected from said sequence ofpictures; selecting at least one of said reference picture or saidtarget picture based upon the first and the second picture brightnessvalues; generating a brightness change factor based on one or more ofgain information for said reference picture, gain information for saidtarget picture, an average pixel value for said reference picture, andan average pixel value for said target picture; remapping image data ofthe selected picture by calculating new pixel values using originalpixel values of the selected picture and said brightness change factor;and performing said motion detection between said reference picture andsaid target picture based upon the remapped image data of the at leastone of said reference picture and said target picture and original imagedata of the picture that was not remapped.
 13. The method according toclaim 12, wherein the first and the second picture brightness values forthe reference picture and the target picture, respectively, aredetermined using one or both of (i) actual measurements of picturebrightness of said reference picture and said target picture and (ii)respective gain or gains applied to each of said reference picture andsaid target picture.
 14. The method according to claim 12, wherein saidimage data is remapped based on at least one of (i) an average pixelvalue of each of said reference picture and said target picture, (ii)digital gains applied to each of said reference picture and said targetpicture, and (iii) analog gains applied to each of said referencepicture and said target picture.
 15. The method according to claim 12,wherein said image data is remapped based upon which picture is darkerthan the other.
 16. The method according to claim 12, whereincalculating said new pixel values comprises: determining a multipliervalue based on one or more of (i) an actual measured picture brightnessof each of said reference picture and said target picture, (ii) anaverage pixel value of each of said reference picture and said targetpicture, (iii) digital gains applied to each of said reference pictureand said target picture, and (iv) analog gains applied to each of saidreference picture and said target picture; and multiplying the originalpixel values of the at least one of said reference picture or saidtarget picture by said multiplier value.
 17. The method according toclaim 12, wherein: remapping said image data is performed by using eachof said original values as an index into at least one of aone-dimensional lookup table and a multi-dimensional lookup table; andentries in said lookup tables are calculated based on said brightnesschange factor.
 18. The method according to claim 12, further comprisingperforming at least one of gamma correction and color correction on saidimage data prior to remapping the image data.
 19. The method accordingto claim 12, further comprising remapping said reference picture in afirst processing mode, remapping said target picture in a secondprocessing mode, and selectively choosing between remapping saidreference picture or remapping said target picture in a third processingmode.
 20. The method according to claim 19, wherein said thirdprocessing mode is configured to remap said image data based upon actualmeasured picture brightness.